//
// Created by 郝羽 on 2018/6/12.
//

#ifndef RTC_XSWITCH2_CHILD_H
#define RTC_XSWITCH2_CHILD_H

#include "config.hpp"

#include <glib-2.0/glib.h>
#include <glib-2.0/gio/gio.h>

struct subprocess;

typedef void (*subprocess_wait_callback)(subprocess*, void*);

subprocess* subprocess_spawn(int child_id, uint16_t metric_port,
        Context &ctx, subprocess_wait_callback, void* data);

GInputStream* subprocess_get_stderr(subprocess*);

void subprocess_signal(subprocess* sub, gint sig);

void subprocess_free(subprocess* sub);

#endif //RTC_XSWITCH2_CHILD_H
